package de.mizi.tilemap.object;

import java.awt.Color;

/**
 * This class holds all the data that is necessary to draw a TilemapObject
 * on a tilemap.
 * @author mizi
 *
 */
public class TilemapObjectDrawData {
	protected char glyph;
	protected Color glyphColor;
	protected Color glyphBackground;
	
	/**
	 * Constructs a new TilemapObjectDrawData with the given character symbol
	 * and the given colors.
	 * @param glyph the character symbol
	 * @param glyphColor the color of the character symbol
	 * @param glyphBackground the background color of the character symbol
	 */
	public TilemapObjectDrawData(char glyph, Color glyphColor, Color glyphBackground) {
		this.glyph = glyph;
		this.glyphColor = glyphColor;
		this.glyphBackground = glyphBackground;
	}

	/**
	 * Get the character symbol.
	 * @return the character symbol
	 */
	public char getGlyph() {
		return glyph;
	}

	/**
	 * Set the character symbol.
	 * @param glyph the new character symbol
	 */
	public void setGlyph(char glyph) {
		this.glyph = glyph;
	}

	/**
	 * Get the color of the character symbol.
	 * @return the color of the character symbol
	 */
	public Color getGlyphColor() {
		return glyphColor;
	}

	/**
	 * Set the color of the character symbol.
	 * @param glyphColor the new color of the character symbol
	 */
	public void setGlyphColor(Color glyphColor) {
		this.glyphColor = glyphColor;
	}

	/**
	 * Get the background color of the character symbol.
	 * @return the background color of the character symbol
	 */
	public Color getGlyphBackground() {
		return glyphBackground;
	}

	/**
	 * Set the background color of the character symbol.
	 * @param glyphBackground the new background color of the character symbol
	 */
	public void setGlyphBackground(Color glyphBackground) {
		this.glyphBackground = glyphBackground;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj == null) {
			return this == null;
		}
		TilemapObjectDrawData other = (TilemapObjectDrawData)obj;
		return glyph == other.glyph && glyphColor.equals(other.glyphColor) && glyphBackground.equals(other.glyphBackground);
	}
}
